package chap1;

import java.util.Scanner;

public class ReadEngThread implements Runnable {
    private String name;       // 表示线程的名称

    public ReadEngThread(String name) {
        this.name = name;      // 通过构造方法配置name属性
    }

    public void run() {  // 覆写run()方法，作为线程 的操作主体
        String  inFilePath="Z01-Example.txt";
        try(Scanner scanner=new Scanner(inFilePath)){
            String line = scanner.nextLine();
        }
        for (int i = 0; i < 10; i++) {
            System.out.println(name + "运行，i = " + i);
        }
    }
}
